const db = uniCloud.database()
module.exports = {
	_before: function () {  //常见问题

	},
	async getData(){
		return {
			code: 0,
			data: await db.collection("self-problem").get(),
			message: "成功"
		}
	},
	async add(form){
		await db.collection("self-problem").add(form)
		
		return {
			code: 0,
			message: "成功"
		}
	},
	async del(id){
		await db.collection("self-problem").doc(id).remove()
		
		return {
			code: 0,
			message: "成功"
		}
	}
}
